import time
def merging(array):
    for i in range(len(array)-1):
        for j in range(i+1,len(array)):
            if array[i]>=array[j]:
                t=array[j]
                array[j]=array[i]
                array[i]=t
a=[int(i) for i in open('m1_sorted.txt')]
b=[int(i) for i in open('m2_reverse.txt')]
c=[int(i) for i in open('m3_shuffle.txt')]

start=time.time()
merging(a)
finish=time.time()
print('m1_sorted',round((finish-start)*1000),'milliseconds')

start=time.time()
merging(b)
finish=time.time()
print('m2_,reverse',round((finish-start)*1000),'milliseconds')
start=time.time()
merging(c)
finish=time.time()
print('m3_shuffle',round((finish-start)*1000),'milliseconds')
